package com.Tadama.Forms;
import com.Tadama.MIDlet.TadamaMIDlet;
import com.Tadama.Utility.CommandBuilder;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;

public class lstPedido extends List implements CommandListener{
    private TadamaMIDlet mainMidlet;
    private Displayable previousDisplay;
    private Command cmAtras = CommandBuilder.getback();
    private Command cmSiguiente = CommandBuilder.getSiguiente();
    
    public lstPedido(TadamaMIDlet mainMidlet, String title, int listType,Displayable previousDisplay) {
        super(title, listType);
        this.mainMidlet = mainMidlet;
        this.previousDisplay = previousDisplay;
        this.append("V.-12-jul-2010 ||03:21pm", null);
        this.append("M.-09-jul-2010 ||05:01pm", null);
        this.append("L.-20-jun-2010 ||10:12am", null);
        this.append("X.-15-jun-2010 ||02:15pm", null);
        this.append("V.-08-jun-2010 ||11:34pm", null);
        this.addCommand(cmAtras);
        this.addCommand(cmSiguiente);
        this.setCommandListener(this);
    }

    public void commandAction(Command c, Displayable d) {
        if(c==cmSiguiente){
            Display.getDisplay(mainMidlet).setCurrent(new frmDevolucion(mainMidlet, previousDisplay));
        }
        if(c==cmAtras){
            Display.getDisplay(mainMidlet).setCurrent(new frmBuscarPedidos("Buscar Pedidos", mainMidlet, previousDisplay));
        }
    }
}